package com.hdu.point_offer;
import java.util.ArrayList;
import java.util.List;

public class lcr180 {
    public static void main(String[] args) {
        new Solution().fileCombination(12);
    }
    static class Solution {
        public int[][] fileCombination(int target) {
            int l = 1, r = 1;
            List<int[]> ans = new ArrayList<>();
            int curSum = 0;
            while (r <= target)
            {
                curSum += r;
                while (curSum == target)
                {
                    int len = r - l + 1;
                    if (len >= 2)
                    {
                        int[] tmp = new int[len];
                        for (int i = l; i <= r; i++)
                        {
                            tmp[i - l] = i;
                        }
                        ans.add(tmp);
                    }
                    curSum -= l;
                    l++;
                }
                r++;
            }
            return ans.toArray(new int[ans.size()][]);
        }
    }
}
